//
//  ContactListener.m
//  StarBugs
//
//  Created by ?? ? on 12/27/11.
//  Copyright 2011 antisword@playorca.com. All rights reserved.
//

#include "Util/ContactListener.h"

ContactListener::ContactListener()
{
       
}
void ContactListener::BeginContact(b2Contact *contact)
{
    MyContact myContact = { contact->GetFixtureA(), contact->GetFixtureB()};
    _contacts.push_back(myContact);
}

void ContactListener::EndContact(b2Contact *contact)
{
    MyContact myContact = { contact->GetFixtureA(), contact->GetFixtureB() };
    std::vector<MyContact>::iterator pos;
    pos = std::find(_contacts.begin(), _contacts.end(), myContact);
    if (pos != _contacts.end()) {
        _contacts.erase(pos);
    }
}

void ContactListener::PreSolve(b2Contact* contact, const b2Manifold* oldManifold)
{
    
}

void ContactListener::PostSolve(b2Contact* contact, const b2ContactImpulse* impulse)
{
    
}
